package com.lvmama.rhino.enums;

/** 
* @ClassName: 搜索品类
* @Description: TODO
* @author shenlinli
* @date 2017年5月3日 上午9:59:35  
*/
public enum CommonSearchType {
    
    ROUTE("ROUTE", "旅游推荐"),
	TICKET("TICKET", "景点门票"),
	SCENICTOUR("SCENICTOUR", "酒+景"),
	FREETOUR("FREETOUR", "自由行"),
	FREESCENICTOUR("FREESCENICTOUR", "自由行"),
	GROUP("GROUP", "跟团游"),
	PLAY("PLAY", "交通+服务"),    
	LOCALPLAY("LOCALPLAY", "当地玩乐"), 
	LOCAL("LOCAL", "当地游"),
    HOTEL("HOTEL", "酒店"),
    SHIP("SHIP", "游轮"),
    VISA("VISA", "签证"),
    LVYUE("LVYUE", "驴悦亲子"),
    AROUND("AROUND", "周边游");

    private String value;
    private String showName;

    private CommonSearchType(String value, String showName) {
        this.value = value;
        this.showName = showName;
    }

    public String getShowName() {
        return showName;
    }

    public String getValue() {
        return value;
    }

    public static CommonSearchType[] getLabType() {
        CommonSearchType[] statusTypeArr = new CommonSearchType[13];
        statusTypeArr[0] = CommonSearchType.ROUTE;
        statusTypeArr[1] = CommonSearchType.TICKET;
        statusTypeArr[2] = CommonSearchType.SCENICTOUR;
        statusTypeArr[3] = CommonSearchType.FREETOUR;
        statusTypeArr[4] = CommonSearchType.GROUP;
        statusTypeArr[5] = CommonSearchType.PLAY;
        statusTypeArr[6] = CommonSearchType.LOCALPLAY;
        statusTypeArr[7] = CommonSearchType.LOCAL;
        statusTypeArr[8] = CommonSearchType.HOTEL;
        statusTypeArr[9] = CommonSearchType.SHIP;
        statusTypeArr[10] = CommonSearchType.VISA;
        statusTypeArr[11] = CommonSearchType.LVYUE;
        statusTypeArr[12] = CommonSearchType.AROUND;
        return statusTypeArr;
    }
    
    
    /** 
    * @Title: getShownameByValue 
    * @Description: 根据英文获取中文名称
    * @param @param value
    * @param @return    设定文件 
    * @return String    返回类型 
    * @throws 
    */
    public static String getShownameByValue(String value) {
        String showName = "";
        if (value != null) {
            CommonSearchType[] types = CommonSearchType.getLabType();
            for (CommonSearchType type : types) {
                if (type.getValue().equals(value)) {
                    showName = type.getShowName();
                    break;
                }
            }
        }
        return showName;
    }
    
    
    /** 
    * @Title: getValueByShowName 
    * @Description: 根据中文名称获取英文名称
    * @param @param showName
    * @param @return    设定文件 
    * @return String    返回类型 
    * @throws 
    */
    public static String getValueByShowName(String showName) {
        String value = "";
        if (showName != null) {
            CommonSearchType[] types = CommonSearchType.getLabType();
            for (CommonSearchType type : types) {
                if (type.getShowName().equals(showName)) {
                	value = type.getValue();
                    break;
                }
            }
        }
        return value;
    }
    
   
}
